package com.app.service.impl;

import com.app.common.FinancingTool;
import com.app.common.ScaleTool;
import com.app.mapper.EnterpriseMapper;
import com.app.mapper.FieldSchoolMapper;
import com.app.model.EnterpriseModel;
import com.app.model.FieldSchoolModel;
import com.app.model.InterviewRecordModel;
import com.app.service.EnterpriseService;
import com.app.service.FieldSchoolService;
import com.app.util.StringTool;
import com.app.vo.EnterpriseVo;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * @Description:学校专业实现类
 * @Author: N
 * @Date: 2022年11月24日 10点29分
 */
@Service
public class FieldSchoolServiceImpl implements FieldSchoolService {

    @Autowired
    FieldSchoolMapper fieldSchoolMapper;


    @Override
    public List<FieldSchoolModel> getListByKeyWord(String keyword) {
        if(StringTool.isEmpty(keyword)){
            return null;
        }
        QueryWrapper<FieldSchoolModel> queryWrapper = new QueryWrapper<>();
        queryWrapper.select().like("field_name",keyword);
        List<FieldSchoolModel> modelList = fieldSchoolMapper.selectList(queryWrapper);
        return modelList;
    }

    @Override
    public List<FieldSchoolModel> getAll() {
        return fieldSchoolMapper.selectList(null);
    }

    @Override
    public List<FieldSchoolModel> getListByFatherCode(String fatherCode) {
        QueryWrapper<FieldSchoolModel> queryWrapper = new QueryWrapper<>();
        queryWrapper.select().eq("father_code",fatherCode);
        List<FieldSchoolModel> modelList = fieldSchoolMapper.selectList(queryWrapper);
        return modelList;
    }
}
